Skip to content

Refactor Appium tests for per-test isolation and improved structure - #22

Merged
Malcolmnixon merged 1 commit into
mainfrom
feature/appium-startapp-fixture
Jul 24, 2026
Merged

Refactor Appium tests for per-test isolation and improved structure#22
Malcolmnixon merged 1 commit into
mainfrom
feature/appium-startapp-fixture

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

This pull request refactors how integration tests preload workspace sources in the application, replacing the single-use SYSML2WORKBENCH_STARTUP_FILE environment variable with a more flexible command-line argument approach. It updates documentation and test fixtures to reflect this, improves per-test isolation for Appium integration tests, and consolidates several menu-item discoverability tests for better reliability and maintainability.

Test infrastructure and application launch improvements:

  • The application now supports preloading multiple workspace sources for integration tests via repeated --startup-source <path> command-line arguments, parsed in ApplyStartupSourceArgumentsForTesting, instead of using the SYSML2WORKBENCH_STARTUP_FILE environment variable. This enables per-test customization of the workspace and avoids cross-test contamination. (src/DemaConsulting.SysML2Workbench/App.axaml.cs)
  • The test fixture and test runner scripts are updated to remove all references to SYSML2WORKBENCH_STARTUP_FILE, and instead pass startup sources as command-line arguments, ensuring each test can control its launch environment independently. (build.ps1, .github/workflows/build.yaml, AppFixture.cs) [1] [2] [3]

Test isolation and reliability:

  • All Appium integration tests now run with their own dedicated application instance and WebDriver session, guaranteeing full isolation and eliminating the need for bespoke cleanup logic in most tests. This is reflected in both the test base class and updated documentation. (docs/verification/ots/appium.md) [1] [2]

Test consolidation and documentation updates:

  • Menu-item discoverability tests for the File and View menus are consolidated into single tests that check all relevant items in one menu open/close cycle, improving test efficiency and reliability. Test documentation and requirements are updated to match the new test structure and clarify the scenarios covered. (docs/reqstream/ots/appium.yaml, docs/verification/ots/appium.md) [1] [2]

Minor improvements:

  • The spelling dictionary is updated to recognize the term "assertable". (.cspell.yaml)
  • Minor code cleanup and documentation clarifications in test and fixture files. (test/DemaConsulting.SysML2Workbench.IntegrationTests/AppFixture.cs)

- Split the monolithic MainWindowShellIntegrationTests.cs into per-feature
  test classes (MainWindowLaunchIntegrationTests, FileMenuIntegrationTests,
  ViewMenuIntegrationTests, QueryDialogIntegrationTests,
  HelpMenuIntegrationTests) built on a new AppiumTestBase that gives every
  [Fact] its own dedicated per-test application launch and WebDriver
  session via StartApp(args), replacing the old shared-session
  [Collection("AppFixture")] pattern so no test's state can leak into
  another.
- Add a generic, cross-platform --startup-source <path> CLI argument
  (App.axaml.cs's ApplyStartupSourceArgumentsForTesting) to preload a
  workspace at launch without driving the unautomatable native OS "Open
  File" dialog, replacing the old SYSML2WORKBENCH_STARTUP_FILE env-var
  hook (removed from build.ps1, .github/workflows/build.yaml, and
  App.axaml.cs).
- Fix a Mac2 AppFixture.ApplyStartupArguments bug where naive space
  splitting left literal quote characters in defensively-quoted,
  space-free argument values.
- Disable xUnit's default cross-collection parallelization
  (GlobalUsings.cs) since each test class is now an implicit collection
  that launches a real desktop app - without this, multiple app instances
  launch simultaneously and fight for OS focus.
- Merge same-menu discoverability checks (File menu's 3 tests, View
  menu's 4 tests) into one test each per menu, and add
  AssertMenuItemsAreDiscoverableAndEnabled to AppiumTestBase so the merged
  tests open the menu once, check every item in place, and close once,
  instead of reopening/closing the menu once per item.
- Merge the Query dialog's round-trip test and its add-type-filter-button
  screenshot test into one, capturing the screenshot inline during the
  existing open/click/assert/close round trip instead of a separate
  open/close cycle and application launch.
- Fix HelpMenuIntegrationTests to verify the About dialog actually closes
  after clicking OK, not just that it opens.
- Update docs/verification/ots/appium.md and
  docs/reqstream/ots/appium.yaml to match the new test structure, merged
  tests, and fixes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Malcolmnixon
Malcolmnixon merged commit 2fbe3e2 into main Jul 24, 2026
7 checks passed
@Malcolmnixon
Malcolmnixon deleted the feature/appium-startapp-fixture branch July 24, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant